

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:study_flutter/home/thridLabary/loadImage.dart';

class ThridLabaryPage extends StatefulWidget{
  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return _ThridLabaryState();
  }
  
}

class _ThridLabaryState extends State<ThridLabaryPage>{

  List<String> list = ["图片加载页面"];

  @override
  void initState() {
    // TODO: implement initState
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    // TODO: implement build
    return Scaffold(
      appBar: AppBar(
        title: Text("第三方库练习"),
      ),
      body: Container(
          child: ListView.builder(
              shrinkWrap: true,
              itemCount: list.length,
              itemBuilder: (BuildContext context, int index){
                return GestureDetector(
                  onTap: (){
                    if (index == 0){
                      Navigator.push(context, MaterialPageRoute(builder: (BuildContext contex){
                        return LoadImagePage();
                      }));
                    }
                  },
                  child: Container(
                    child: Text(
                      list[index],
                    ),
                    height: 50,
                  ),
                );
              })
      ),
    );
  }
}